﻿using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace myWindowsMediaPlayer
{
    public class Library
    {
        public static List<string> getFromDir(string path, bool mode)
        {
            List<string> audioExt = new List<string> { "*.mp3", "*.wma", "*.wav" };
            List<string> videoExt = new List<string> { "*.avi", "*.mkv", "*.wmv", "*.mp4" };
            List<string> Files = new List<string>();
            foreach (string str in (mode ? audioExt : videoExt))
                Files.AddRange(new List<string>(Directory.GetFiles(path, str, SearchOption.AllDirectories).ToList()));
            return (Files);
        }
    }
}
